#include <stdio.h>

int search(char str[], char t)
{
    int i = 0;

    while(str[i] != '\0')
    {
        if(str[i] == t)
        {
            return i + 1;
        }
    }
    return -1;
}

int main()
{
    char str[20] = "helloword";
    char t = "o";
    int result;

    result = search(str[20], t);

    printf("%d", result);

    return 0;
}